﻿using System;
using System.Collections.Generic;

namespace LastLand.Data.World
{
    public class CWorldGrid
    {
        private Int32 posX_;
        private Int32 posY_;

        private Int32 foodProdRate_;
        private Int32 hammerProdRate_;
        private Int32 goldProdRate_;

        private Int32 foodLimit_;
        private Int32 hammerLimit_;
        private Int32 goldLimit_;

        private Int32 food_;
        private Int32 hammer_;
        private Int32 gold_;

        private Int32 farmLevel_;
        private Int32 mineLevel_;
        private Int32 villageLevel_;
        private Int32 fortLevel_;
        private Int32 cityLevel_;

        private CCity city_;
        private CCountry country_;
        private CCombat combat_;

        private static Random rand_ = new Random();

        public CWorldGrid(Int32 _posX, Int32 _posY)
        {
            posX_ = _posX;
            posY_ = _posY;

            foodProdRate_ = rand_.Next(1, 3);
            hammerProdRate_ = rand_.Next(1, 3);
            goldProdRate_ = rand_.Next(1, 3);

            foodLimit_ = rand_.Next(10, 100);
            hammerLimit_ = rand_.Next(10, 100);
            goldLimit_ = rand_.Next(10, 100);

            food_ = 0;
            hammer_ = 0;
            gold_ = 0;

            farmLevel_ = 0;
            mineLevel_ = 0;
            villageLevel_ = 0;
            fortLevel_ = 0;
            cityLevel_ = 0;

            city_ = null;
            country_ = null;
            combat_ = null;
        }

        public Int32 PosX
        {
            get { return posX_; }
        }

        public Int32 PosY
        {
            get { return posY_; }
        }

        public Boolean IsTerritory()
        {
            return country_ != null;
        }

        public CCity City
        {
            get { return city_; }
            set { city_ = value; }
        }

        public CCountry Country
        {
            get { return country_; }
            set { country_ = value; }
        }

        public Int32 Food
        {
            get { return food_; }
            set { food_ = value; }
        }

        public Int32 Hammer
        {
            get { return hammer_; }
            set { hammer_ = value; }
        }

        public Int32 Gold
        {
            get { return gold_; }
            set { gold_ = value; }
        }

        public Int32 FarmLevel
        {
            get { return farmLevel_; }
            set { farmLevel_ = value; }
        }

        public Int32 MineLevel
        {
            get { return mineLevel_; }
            set { mineLevel_ = value; }
        }

        public Int32 VillageLevel
        {
            get { return villageLevel_; }
            set { villageLevel_ = value; }
        }

        public Int32 FortLevel
        {
            get { return fortLevel_; }
            set { fortLevel_ = value; }
        }

        public Int32 CityLevel
        {
            get { return cityLevel_; }
            set { cityLevel_ = value; }
        }

        public Int32 FoodProdRate
        {
            get { return foodProdRate_; }
        }

        public Int32 HammerProdRate
        {
            get { return hammerProdRate_; }
        }

        public Int32 GoldProdRate
        {
            get { return goldProdRate_; }
        }

        public Int32 FoodLimit
        {
            get { return foodLimit_; }
        }

        public Int32 HammerLimit
        {
            get { return hammerLimit_; }
        }

        public Int32 GoldLimit
        {
            get { return goldLimit_; }
        }

        public CCombat Combat
        {
            get { return combat_; }
            set { combat_ = value; }
        }
    }
}
